]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dateMenu: Watch for a resume, and update the clock
authorColin Walters <walters@verbum.org>
Fri, 12 Aug 2011 14:06:19 +0000 (10:06 -0400)
committerColin Walters <walters@verbum.org>
Fri, 12 Aug 2011 21:05:57 +0000 (17:05 -0400)
Otherwise it can be very out of date.

https://bugzilla.gnome.org/show_bug.cgi?id=656403

js/ui/dateMenu.js

index a48fde7775e43435cb8f81f1e01f610503d8a48e..edad21e65a616cbb96b257e82764072b29e65792 100644 (file)
@@ -14,6 +14,7 @@ const Main = imports.ui.main;
 const PanelMenu = imports.ui.panelMenu;
 const PopupMenu = imports.ui.popupMenu;
 const Calendar = imports.ui.calendar;
+const UPowerGlib = imports.gi.UPowerGlib;
 
 // in org.gnome.desktop.interface
 const CLOCK_FORMAT_KEY        = 'clock-format';
@@ -142,6 +143,10 @@ DateMenuButton.prototype = {
         this._desktopSettings.connect('changed', Lang.bind(this, this._updateClockAndDate));
         this._clockSettings.connect('changed', Lang.bind(this, this._updateClockAndDate));
 
+        // https://bugzilla.gnome.org/show_bug.cgi?id=655129
+        this._upClient = new UPowerGlib.Client();
+        this._upClient.connect('notify-resume', Lang.bind(this, this._updateClockAndDate));
+
         // Start the clock
         this._updateClockAndDate();
     },